<link rel="stylesheet" href="plugin/awesome4/css/font-awesome.min.css"/>

温馨提示：如果您需要修改产品的资料信息，请联系我们或给我们发E-mail<br/>
<style type="text/css">
    .ul_one li {float: left;margin: 0px 20px 10px 0px;}
    .goodsCatBox select{
        float: left;
        height: 28px;
        width: 150px;
        display: block;
        margin: 6px 10px;
    }
    .goodsCatBox:after {display:block;clear:both;content:"";visibility:hidden;height:0}
    .goodsCatBox{zoom:1}
</style>
<form action="<?php e_page("goods","index")?>" method="get">
    <fieldset>
        <legend></legend><br/>

        <label for="goodsLabel">商品标签</label>
        <select name="goodsLabel" id="goodsLabel">
            <option value='' >所有</option>
            <?php foreach($r['label'] as $v){?>
                <option value="<?php echo $v['id']?>" <?php if($r['goodsLabel']==$v['id']) echo 'selected'?> ><?php echo $v['name']?></option>
            <?php }?>
        </select>
        <label for="id">ID</label><br/>
        <input id="id" name="id" type="text" placeholder="请输入要搜索的商品ID"><br/>
        <label for="shopName">商品名称</label><br/>
        <input id="shopName" name="shopName" type="text" placeholder="请输入要搜索的商品名称">
        <input type="submit" value="搜索"><br/>
        <div>
            <ul class="ul_one"><?php
                $up='fa fa-long-arrow-down';
                $down='fa fa-long-arrow-up';
                $i['base_price']=isset($r['base_price']) ? $r['base_price']?$down:$up :$down;
                $a['base_price']=isset($r['base_price'])?!$r['base_price']:0;
                $i['sale']=isset($r['sale'])? $r['sale']?$down:$up :$down;
                $a['sale']=isset($r['sale'])?!$r['sale']:0;
                $i['comment']=isset($r['comment'])?  $r['comment']?$down:$up :$down;
                $a['comment']=isset($r['comment'])?!$r['comment']:0;
                ?>
                <li><a href="<?php e_qus(array('id'=>$r['id'],'shopName'=>$r['shopName'],'goodsLabel'=>$r['goodsLabel'],'orderBy'=>'base_price','asc'=>$a['base_price'])) ?>">
                        价格<i class="<?=$i['base_price']?>"></i></a></li>
                <li><a href="<?php e_qus(array('id'=>$r['id'],'shopName'=>$r['shopName'],'goodsLabel'=>$r['goodsLabel'],'orderBy'=>'sale','asc'=>$a['sale'])) ?>">
                        销量<i class="<?=$i['sale']?>"></i></a></li>
                <li><a href="<?php e_qus(array('id'=>$r['id'],'shopName'=>$r['shopName'],'goodsLabel'=>$r['goodsLabel'],'orderBy'=>'comment','asc'=>$a['comment'])) ?>">
                        评论<i class="<?=$i['comment']?>"></i></a></li>
            </ul>
        </div>
    </fieldset>
</form>
<?php if(empty($r['goods_info'])){ echo "亲，暂时还没有商品哦~"?>
    <?php }else{?>
    <table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>所属分类</th>
        <th>商品类型</th>
        <th>商品名</th>
        <th>价格</th>
        <th>库存</th>
        <th>销量</th>
        <th>评论数</th>
        <th>修改时间</th>
        <th>服务站服务费</th>
        <th>代购分成</th>
        <th>普团服务费</th>
        <th>分享分成</th>
        <th>所属标签</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($r['goods_info'] as $v){?>
        <tr>
            <td><?php echo $v['gopen_id']?></td>
            <td><?php echo $v['goods_cat']?></td>
            <td><?php echo $r['shopType'][$v['type']];?></td>
            <td><?php if(mb_strlen($v['name'])<13)
                    echo $v['name'];
                else
                    echo mb_substr($v['name'],0,12,"UTF-8"),"..."
                ?></td>
            <td><?php echo "￥",$v['price']['base_price'] ?></td>
            <td><?php echo $v['stock']?><?php echo $v['unit']?></td>
            <td><?php echo $v['sale']?><?php echo $v['unit']?></td>
            <td><?php echo $v['comment']?>条</td>
            <td><?php echo $v['create_time']?></td>
            <td><?php echo "￥",$v['service_fee']?></td>
            <td><?php echo "￥",$v['commission']?></td>
            <td><?php echo "￥",$v['platform_fee']?></td>
            <td><?php echo "￥",$v['bonus']?></td>
            <td>
                <?php foreach($v['label'] as $k=>$l){?>
                    <?php echo $l['name'];?>
                    <?php if($k%3==2) echo "<br>"; ?>
                <?php }?>
            </td>
            <td><a href='<?php e_action("detail","gopen_id={$v['gopen_id']}");?>'>查看详情</a></td>
        </tr>
    <?php } ?>
    </tbody>
</table>
<?php echo $r['page']->getPageHtml(); ?>
<?php }?>